﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Master
{
    /// <summary>
    /// Interaction logic for CtrlAddCar.xaml
    /// </summary>
    /// 
    /**
     * @Creator: J.J. Burgers
     * @Changes made by:
     *      - A.J. Janssen
     *      - V.L. de Jager
     * */
    public partial class CtrlAddCar : UserControl
    {
        private SpawnPoint spawnPoint;

        public CtrlAddCar()
        {
            InitializeComponent();
        }

        public void setSpawnPoint(SpawnPoint spawnPoint)
        {
            this.spawnPoint = spawnPoint;
        }

        private void surfaceSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            int value = (int)e.NewValue;
            label.Content = value;
        }

        private void surfaceButton_Click(object sender, RoutedEventArgs e)
        {
            int NumberOfCars = (int)surfaceSlider.Value;
            Map.INSTANCE.addCar(this.spawnPoint, NumberOfCars);
        }

      

    }
}
